FROM jenkins/jenkins
EXPOSE 8080
 
# 将maven和jdk添加到容器中
# tar.gz添加进去后会自动解压，无需手动解压
ADD apache-maven-3.6.1-bin.tar.gz /usr/local
ADD openjdk-8u44-linux-x64.tar.gz /usr/local
ADD node-v14.0.0-linux-x64.tar.gz /usr/local
 
# 覆盖容器里的settings.xml
ADD settings.xml /usr/local/apache-maven-3.6.1/conf/
 
# 配置环境变量
ENV TZ=Asia/Shanghai
ENV M2_HOME=/usr/local/apache-maven-3.6.1
ENV NODE_HOME=/usr/local/node-v14.0.0-linux-x64
 
# 配置maven、node的环境变量
# jdk环境变量不可在这里配，会影响jenkins的运行
ENV PATH=$M2_HOME/bin:$NODE_HOME/bin:$PATH

